/*
 * Copyright (C) Michael Opitz
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 * USA
 */
#ifndef ALBUM_H
#define ALBUM_H

#include "title.h"
#include "dom.h"

#include <boost/shared_ptr.hpp>

#include <string>
#include <list>

using namespace std;

/**
 * \brief This namespace contains all model-classes.
 * \author Michael Opitz
 */
namespace model {
	/** 
	 * \brief This class represents an album.
	 */
	class album {
	public:
		album() {}
		/** 
		 * \brief album creates an album from an dom-node
		 * 
		 * \param node is the node from which the album should be
		 * created
		 */
		album(const model::dom &node);
		/** 
		 * \brief album creates a album with a name, and a list of
		 * titles.
		 * 
		 * \param name is the name of the album.
		 * \param t is a list of titles.
		 */
		album(const string &name, const list<model::title> t)
		: _name(name), _titles(t) {}
		~album() {}

		/** 
		 * \brief parse parses a dom-node to the internal structure of
		 * the album
		 * 
		 * \param node is the dom-node which should be parsed
		 */
		void parse(const model::dom &node);

		/** 
		 * \brief set_name sets the name of the album
		 */
		void set_name(const string &name) { _name = name; }
		/** 
		 * \brief get_name returns the name of the album
		 */
		const string& get_name() const {return _name;}

		void set_titles(const list<model::title> &t) {_titles = t;}
		/** 
		 * \brief get_titles returns a list of titles the album contains
		 */
		const list<model::title>& get_titles() const {return _titles;}
		/** 
		 * \brief get_titles returns a list of titles the album contains
		 */
		list<model::title>& get_titles() {return _titles;}

		/** 
		 * \brief print prints the album. For debug purposes only.
		 */
		void print() const;
		/** 
		 * \brief to_xml prints the xml-structure of the album
		 */
		string to_xml() const;
	private:
		string _name;
		list<model::title> _titles;
	};
}

#endif
